'use client';

import React from 'react';
import { Table } from 'antd';
import type { ColumnsType } from 'antd/es/table';

interface BillRecord {
  id: string;
  operatorId: string;
  operatorName: string;
  operateTime: string;
  amount: number;
  description: string;
}

interface TeamBillTableProps {
  teamId: string;
}

const TeamBillTable: React.FC<TeamBillTableProps> = ({ teamId }) => {
  // 模拟数据
  const mockData: BillRecord[] = [
    {
      id: '1',
      operatorId: '18812341234',
      operatorName: '18812341234(姓名)',
      operateTime: '2025-03-28 10:30',
      amount: 1000,
      description: '余额 +1000',
    },
    {
      id: '2',
      operatorId: '18812341234',
      operatorName: '18812341234(姓名)',
      operateTime: '2025-03-28 10:30',
      amount: -1000,
      description: '余额 -1000',
    },
  ];

  const columns: ColumnsType<BillRecord> = [
    {
      title: '序号',
      dataIndex: 'id',
      width: 80,
      render: (_, __, index) => index + 1,
    },
    {
      title: '操作人',
      dataIndex: 'operatorName',
      width: 200,
    },
    {
      title: '操作时间',
      dataIndex: 'operateTime',
      width: 180,
      sorter: true,
    },
    {
      title: '修改内容',
      dataIndex: 'description',
    },
  ];

  return (
    <Table
      columns={columns}
      dataSource={mockData}
      rowKey="id"
      pagination={{
        total: 658,
        pageSize: 10,
        showQuickJumper: true,
        showSizeChanger: true,
        showTotal: (total) => `共 ${total} 条`,
      }}
    />
  );
};

export default TeamBillTable; 